Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handled methods camera#move and camera#animate #30

Merged
merged 9 commits into from
Mar 27, 2019

Conversation

andrea689
Copy link
Collaborator

I don't know how to handle 'zoomBy with focus'
You have some ideas?

@tobrun
Copy link
Collaborator

tobrun commented Mar 6, 2019

@andrea689 thanks again for contributing! Could you send me an email? would love to setup collaborator rights for you so you can push directly to this repository.

zoomBy with focus'

zoomBy is zooming with a specific amount of zoom and focus is using a focal point (a x,y position on screen). The iOS SDK will have a functionality available where you can convert a x,y positon on screen to a LatLng, this value together with the zoom can be used to calculate a new camera position.

Note that the concept of zoom on Android is very different than the altitude on the iOS SDK. We will need to find a conversion for it. (I have pinged the Mapbox iOS team for it).

@tobrun tobrun added ios enhancement New feature or request labels Mar 6, 2019
@tobrun
Copy link
Collaborator

tobrun commented Mar 7, 2019

@andrea689 capturing from an iOS engineer working on the maps SDK, you can use:
MGLZoomLevelForAltitude() / MGLAltitudeForZoomLevel(). to convert the value you get from flutter to an altitude expected by the iOS maps SDK API.

@andrea689
Copy link
Collaborator Author

@tobrun thanks for the opportunity, I send you an email.
I have already used those methods, my doubt is on the focal point.
On Android there is a method, but on iOS there is nothing that I know.
After conversion of zoom to altitude and set this on camera, how I use focus? Using it as a center of camera is wrong I think.

@tobrun tobrun requested review from tobrun and yoavrofe March 9, 2019 14:00
@tobrun tobrun added this to the 0.0.2 milestone Mar 9, 2019
@tobrun
Copy link
Collaborator

tobrun commented Mar 13, 2019

On Android there is a method, but on iOS there is nothing that I know.

correct, we can actually opt to not expose. I don't feel this is a highly needed feature. Can you remove it from the flutter and android code?

Copy link
Collaborator

@tobrun tobrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrea689 was finally able to get my iOS dev. env. working. I had to export SWIFT_VERSION=3 as env. variable. I took this PR for a spin and is already looking good! tiltTo doesn't seem to be doing anything, the zoomBy with focus can be removed.

@andrea689
Copy link
Collaborator Author

@tobrun in the example, tiltTo use the same value of newCameraPosition, so I think you don't see nothing because you has pressed newCameraPosition before tiltTo

[ios] implemented zoomBy with focus
@andrea689
Copy link
Collaborator Author

andrea689 commented Mar 14, 2019

@tobrun I used the focal point as a center of camera and seems work as Android! :D
@yoavrofe can review now, thanks!

@tobrun
Copy link
Collaborator

tobrun commented Mar 23, 2019

@andrea689 would you be able to rebase this branch?

This branch cannot be rebased due to conflicts
Rebasing the commits of this branch on top of the base branch cannot be performed automatically due to conflicts encountered while reapplying the individual commits from the head branch.

Copy link
Collaborator

@yoavrofe yoavrofe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@tobrun tobrun merged commit 453ee90 into flutter-mapbox-gl:master Mar 27, 2019
@tobrun tobrun modified the milestones: 0.0.2, v0.0.3 Mar 27, 2019
SheaSmith pushed a commit to SheaSmith/flutter-mapbox-gl that referenced this pull request Sep 15, 2019
* first iOS implementation

* [ios] handled method map#waitForMap

* [ios] added interpretation of MapboxOptions and initial configuration
[ios] handled method map#update

* added SWIFT_VERSION to Podfile
deleted MapboxGLFactory.swift

* [ios] handled methods camera#move and camera#animate

* corrected README

* [ios] fixed y coordinate from scrollBy
[ios] implemented zoomBy with focus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants